package com.gxa.service.impl;

import com.gxa.service.DepartmentService;
import com.gxa.mapper.DepartmentMapper;
import com.gxa.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("departmentService")
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    DepartmentMapper departmentMapper;

    @Override
    public List<Department> findAllDepartmenByPage(Integer start, Integer pageSize) {
        return departmentMapper.findAllDepartmentByPage(start,pageSize);
    }

    @Override
    public Integer findAllDepartment() {
        return departmentMapper.findAllDepartment();
    }

    @Override
    public List<Department> findAll() {
        return departmentMapper.findAll();
    }

    @Override
    public int insertDepartment(Map map) {
        return departmentMapper.insertDepartment(map);
    }

    @Override
    public Integer updateDepartmentById(Map map) {
        return departmentMapper.updateDepartmentById(map);
    }

    @Override
    public Integer deleteDepartmentById(Integer id) {
        return departmentMapper.deleteDepartmentById(id);
    }

    @Override
    public Integer departmentState(Map map) {
        return departmentMapper.departmentState(map);
    }

    @Override
    public String findDepartmentByName(String name) {
        return departmentMapper.findDepartmentByName(name);
    }
}